﻿using RuoVea.ExSugar.Attributes;
using RuoVea.ExSugar.Entity;
using SqlSugar;
using System.ComponentModel;

namespace RuoVea.OmiApi.Log.Entitys;

/// <summary>
/// 系统差异日志表
/// </summary>
[SugarTable(nameof(SysLogDiff), "差异日志表")]
[Description("系统差异日志表")]
[Tenant("0")]
public partial class SysLogDiff : AutoKeyBase
{
    /// <summary>
    /// 操作前记录
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(BeforeData), columnDescription:"操作前记录", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string BeforeData { get; set; }

    /// <summary>
    /// 操作后记录
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(AfterData), columnDescription:"操作后记录", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string AfterData { get; set; }

    /// <summary>
    /// Sql
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(Sql), columnDescription:"Sql", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string Sql { get; set; }

    /// <summary>
    /// 参数  手动传入的参数
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(Parameters), columnDescription:"参数", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
    public string Parameters { get; set; }

    /// <summary>
    /// 业务对象
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(BusinessData), columnDescription:"业务对象", IsNullable = true)]
    public string BusinessData { get; set; }

    /// <summary>
    /// 差异操作
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(DiffType), columnDescription:"差异操作", Length = 32, IsNullable = true)]
    public string DiffType { get; set; }

    /// <summary>
    /// 耗时
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(Elapsed), columnDescription:"耗时", IsNullable = true)]
    public long? Elapsed { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [ConfigSugarColumn(columnKey: nameof(CreateTime), columnDescription:"创建时间", IsOnlyIgnoreUpdate = true)]
    public virtual DateTime? CreateTime { get; set; }
}